package 第四章作业.O414;

import java.util.Random;
import java.util.Scanner;

public class Guess {
    public static void main(String[] args) {
        Random random = new Random();
        Scanner reader = new Scanner(System.in);
        System.out.println("让我们来玩游戏吧");
        System.out.println("请在0-100中猜一个数");
        int guess = random.nextInt(101);
        for(int i = 1;i >= 1; i++){
            int a = reader.nextInt();
            if(i == 1){
                if(a == guess){
                    System.out.println("你真厉害，一次就猜对了！");
                    break;
                }
                else if(a < guess){
                    System.out.println("小啦！");
                }
                else if(a > guess){
                    System.out.println("大啦！");
                }
            }
            else if(2 <= i && i <= 4){
                if(a == guess){
                    System.out.println("你很聪明，猜对了！");
                    break;
                }
                else if(a < guess){
                    System.out.println("小啦！");
                }
                else if(a > guess){
                    System.out.println("大啦！");
                }
            }
            else if(i >= 5){
                if(a == guess){
                    System.out.println("笨蛋，你猜这么多次！");
                    break;
                }
                else if(a < guess){
                    System.out.println("小啦！");
                }
                else if(a > guess){
                    System.out.println("大啦！");
                }
            }
        }
    }
}